import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '../layout/Layout.vue'
import Layout2 from "../layout/Layout2.vue";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Layout',
    component: Layout,
    redirect:"/user",
    children:[
      {
        path: '/user',
        name: 'User',
        component: () => import("@/views/User")
      },
      {
        path: '/association',
        name: 'Association',
        component: () => import("@/views/Association")
      }
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import("@/views/Login")
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import("@/views/Register")
  },
  {
    path: '/uinformation',
    name: 'Uinformation',
    component: () => import("@/views/Uinformation")
  },
  {
    path: '/main',
    name: 'Main',
    component: () => import("@/views/Main")
  },
  {
    path: '/activity',
    name: 'Activity',
    component: () => import("@/views/Activity")
  },
  {
    path: '/alogin',
    name: 'Alogin',
    component: () => import("@/views/Alogin")
  },
  {
    path: '/',
    name: 'Layout2',
    component: Layout2,
    redirect:"/user",
    children:[
      {
        path: '/president',
        name: 'President',
        component: () => import("@/views/President")
      },
      {
        path: '/essay',
        name: 'Essay',
        component: () => import("@/views/Essay")
      },
      {
        path: '/uinformation',
        name: 'Uinformation',
        component: () => import("@/views/Uinformation")
      }
    ]
  },


]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
